package com.extension.company.view.details;

import android.content.Context;
import android.os.Bundle;
import android.support.annotation.Nullable;
import android.support.v4.app.Fragment;
import android.support.v7.widget.LinearLayoutManager;
import android.support.v7.widget.RecyclerView;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;

import com.extension.company.admin.R;
import com.extension.company.view.adapter.RecommendAdapter;

import java.util.ArrayList;
import java.util.List;


/**
 * 图文详情webview的Fragment
 */
public class GoodsDetailWebFragment extends Fragment {

	private LayoutInflater inflater;
	private Context mContext;
	private List<String> list = new ArrayList<>();


	@Override
	public void onAttach(Context context) {
		super.onAttach(context);
		this.mContext = context;
	}

	@Nullable
	@Override
	public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
		this.inflater = inflater;
		View rootView = inflater.inflate(R.layout.fragment_second_floor, null);
		initView(rootView);
		return rootView;
	}

	public void initView(View rootView) {

		RecyclerView recyclerView = rootView.findViewById(R.id.some_recommend);
		LinearLayoutManager linearLayoutManager = new LinearLayoutManager(mContext);
		linearLayoutManager.setOrientation(LinearLayoutManager.HORIZONTAL);
		recyclerView.setLayoutManager(linearLayoutManager);
		recyclerView.setAdapter(new RecommendAdapter(mContext, list));


	}

}
